﻿using System;
using System.Collections.Generic;
using System.Text;
using NLBS.Data.Business;
using NLBS.Entity;

namespace NLBS.Control
{
   public class TagListControl:System.Web.UI.Control
    {



       protected override void Render(System.Web.UI.HtmlTextWriter writer)
       {
           StringBuilder sb = new StringBuilder();
           sb.Append("<div class=\"tagpanel\">");

           foreach (string item in TagData.GetTag().Keys)
           {
               sb.AppendFormat("<a href=\"javascript:void(0)\">{0}</a>", item);
           }
           sb.Append("</div>");

           sb.Append("<script src=\"/Common/Script/jquery-1.2.3.pack.js\" type=\"text/javascript\"></script>");
           sb.Append("<script src=\"/Common/Script/jquery.jTagging.js\" type=\"text/javascript\"></script>");
           
           this.Page.ClientScript.RegisterStartupScript(this.GetType(), "jtag", "$(\"#log_tag\").jTagging($(\".tagpanel\"), \",\");", true);
          
           writer.Write(sb.ToString());
           base.Render(writer);
       }

       protected override void OnPreRender(EventArgs e)
       {
           
           base.OnPreRender(e);
       }
    }
}
